<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="parent">
      <div class="son">22</div>
    </div>
  </body>
  <style>
    .parent {
      width: 400px;
      height: 400px;
      background-color: rgb(43, 170, 192);
      display: table;
      text-align: center;
    }
    .son {
      background-color: #fff;
      width: 20px;
      height: 20px; 
      display: table-cell;
      /* 只能实现垂直居中 可配合text-align*/
      vertical-align: middle; 
    }
  </style>
</html>
